package es.ucm.fdi.lps.abadia.configuracion.entrada;

import java.io.IOException;
import java.util.Properties;
import static es.ucm.fdi.lps.abadia.general.Constantes.*;
import javax.security.auth.login.Configuration;

public class ParserProperties {
	Properties properties = null;
	
	private ParserProperties() {
		this.properties = new Properties();
		try {
			properties.load(Configuration.class.getClassLoader().getResourceAsStream(FICHERO_CONFIGURACION));
		} catch (IOException ex) {
			ex.printStackTrace();
		}
	}
	
	public static ParserProperties dameEjemplar(){
		return PoseedorParser.INSTANCIA;
	}
	
	private static class PoseedorParser {
		private static final ParserProperties INSTANCIA = new ParserProperties();
	}
	
	public String damePropiedad(String nombre) {
		return this.properties.getProperty(nombre);
	}

}
